﻿@model ReturnableViewModel<IList<UserInfoJson>>

@{
	ViewData["Title"] = "Subscribers";
}

<h2>@ViewData["Title"]</h2>

@if (Model.Item == null)
{
	<p>No items found.</p>
}
else
{
	@foreach (var item in Model.Item)
	{
		<div class="media">
			<img class="mr-3" src="@item.headimgurl" style="width:64px;" />
			<div class="media-body">
				<h5 class="mt-0">
					<span>@item.nickname</span>
					@{
						switch (item.sex)
						{
							case 1:
								<i class="fas fa-mars text-primary"></i>
								break;
							case 2:
								<i class="fas fa-venus text-danger"></i>
								break;
							default:
								break;
						}
					}
				</h5>
				<dl class="dl-horizontal">
					<dt>OpenId</dt>
					<dd>
						<div class="text-truncate" style="width:150px;" data-container="body" data-toggle="popover" data-placement="bottom" data-content="@item.openid">@item.openid</div>
					</dd>
					<dt>Province</dt>
					<dd>@item.province</dd>
					<dt>City</dt>
					<dd>@item.city</dd>
					<dt>Subscribe Time</dt>
					<dd>@WeixinTimestampHelper.ToLocalTime(item.subscribe_time)</dd>
				</dl>
				<a asp-action="SendWeixin" asp-route-openid="@item.openid">发送微信消息</a>
			</div>
		</div>
		<hr />
	}
}